<?php
function ouvrirBase()
{
	try
	{
		$pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
		$bdd = new PDO('mysql:host=localhost/dilemnia;dbname=dilemnia','root','farfadet' , $pdo_options);
		//$bdd = new PDO('mysql:host=au.dragon.joueur.sql.free.fr;dbname=au_dragon_joueur','au.dragon.joueur','farfadet' , $pdo_options);
		$bdd->exec("SET CHARACTER SET utf8");
		$bdd->exec("SET NAMES utf8");
	}
	catch( Exception $e ) 
	{
		die('Erreur : ' . $e->getMessage() );
	}
	return $bdd;
}
?>
